'use strict';

/**
 * Config for the router
 */
angular.module('app')
  .run(
    [          '$rootScope', '$state', '$stateParams',
      function ($rootScope,   $state,   $stateParams) {
          $rootScope.$state = $state;
          $rootScope.$stateParams = $stateParams;
      }
    ]
  )
  .config(['$stateProvider', '$urlRouterProvider',
      function ($stateProvider,   $urlRouterProvider) {

          $urlRouterProvider
              .otherwise('/app/home');
          $stateProvider
              .state('app', {
                  abstract: true,
                  url: '/app',
                  templateUrl: 'tpl/app.html'
              })
              .state('app.home',{
                  url:'/home',
                  templateUrl:'tpl/dashboard.html',
                  resolve: {
                      deps: ['$ocLazyLoad',
                          function ($ocLazyLoad) {
                              return $ocLazyLoad.load(['vendor/jquery/echarts-2.2.7/build/dist/echarts-all.js',
                                  'js/controllers/home/home.js',
                                  'js/services/home/home.js']);
                          }]
                  }
              })

              //account
              .state('app.accountInternal', {
                  url: '/security/account/internal',
                  templateUrl: 'tpl/security/account_internal.html',
                  resolve: {
                      deps: ['$ocLazyLoad',
                          function ($ocLazyLoad) {
                              return $ocLazyLoad.load([
                                  'js/services/security/account.js',
                                  'js/controllers/security/account.js']);
                          }]
                  }
              })

              .state('app.accountOperation', {
                  url: '/security/account/operation',
                  templateUrl: 'tpl/security/account_operation.html',
                  resolve: {
                      deps: ['$ocLazyLoad',
                          function ($ocLazyLoad) {
                              return $ocLazyLoad.load([
                                  'js/services/security/account.js',
                                  'js/controllers/security/account.js']);
                          }]
                  }
              })

              .state('app.accountShop', {
                  url: '/security/account/shop',
                  templateUrl: 'tpl/security/account_shop.html',
                  resolve: {
                      deps: ['$ocLazyLoad',
                          function ($ocLazyLoad) {
                              return $ocLazyLoad.load([
                                  'js/services/security/account.js',
                                  'js/controllers/security/account.js']);
                          }]
                  }
              })

              .state('app.accountShopEdit', {
                  url: '/security/account/shop/edit/:systemUserId/:systemId',
                  templateUrl: 'tpl/security/account_shop_edit.html',
                  resolve: {
                      deps: ['$ocLazyLoad',
                          function ($ocLazyLoad) {
                              return $ocLazyLoad.load([
                                  'js/services/security/account.js',
                                  'js/controllers/security/account.js']);
                          }]
                  }
              })

              .state('app.accountOperationEdit', {
                  url: '/security/account/operation/edit/:systemUserId',
                  templateUrl: 'tpl/security/account_operation_edit.html',
                  resolve: {
                      deps: ['$ocLazyLoad',
                          function ($ocLazyLoad) {
                              return $ocLazyLoad.load([
                                  'js/services/security/account.js',
                                  'js/controllers/security/account.js']);
                          }]
                  }
              })

              .state('app.accountInternalEdit', {
                  url: '/security/account/internal/edit/:systemUserId',
                  templateUrl: 'tpl/security/account_internal_edit.html',
                  resolve: {
                      deps: ['$ocLazyLoad',
                          function ($ocLazyLoad) {
                              return $ocLazyLoad.load([
                                  'js/services/security/account.js',
                                  'js/controllers/security/account.js']);
                          }]
                  }
              })

              .state('app.nowAccountInternalEdit', {
                  url: '/security/now/account/internal/edit',
                  templateUrl: 'tpl/security/now_account_internal_edit.html',
                  resolve: {
                      deps: ['$ocLazyLoad',
                          function ($ocLazyLoad) {
                              return $ocLazyLoad.load([
                                  'js/services/security/account.js',
                                  'js/util/public_key.js',
                                  'js/util/jsencrypt.min.js',
                                  'js/controllers/security/account.js']);
                          }]
                  }
              })



              .state('app.accountCreate', {
                  url: '/security/account/create/:type',
                  templateUrl: 'tpl/security/account_add.html',
                  resolve: {
                      deps: ['$ocLazyLoad',
                          function ($ocLazyLoad) {
                              return $ocLazyLoad.load([
                                  'js/services/security/account.js',
                                  'js/controllers/security/account.js']);
                          }]
                  }
              })

              //role
              .state('app.role',{
                  url:'/role',
                  templateUrl:'tpl/security/role.html',
                  resolve: {
                      deps: ['$ocLazyLoad',
                          function ($ocLazyLoad) {
                              return $ocLazyLoad.load([
                                  'js/services/security/role.js',
                                  'js/controllers/security/role.js']);
                          }]
                  }
              })

              .state('app.roleCreate', {
                  url: '/security/role/create',
                  templateUrl: 'tpl/security/role_add.html',
                  resolve: {
                      deps: ['$ocLazyLoad',
                          function ($ocLazyLoad) {
                              return $ocLazyLoad.load([
                                  'js/services/security/role.js',
                                  'js/controllers/security/role.js']);
                          }]
                  }
              })
              .state('app.roleEdit', {
                  url: '/security/role/edit/:id',
                  templateUrl: 'tpl/security/role_edit.html',
                  resolve: {
                      deps: ['$ocLazyLoad',
                          function ($ocLazyLoad) {
                              return $ocLazyLoad.load([
                                  'js/services/security/role.js',
                                  'js/controllers/security/role.js']);
                          }]
                  }
              })
              .state('app.authorize', {
                  url: '/security/authorize/:id/:platform',
                  templateUrl: 'tpl/security/authorize.html',
                  resolve: {
                      deps: ['$ocLazyLoad',
                          function ($ocLazyLoad) {
                              return $ocLazyLoad.load('angularBootstrapNavTree').then(
                                  function(){
                                      return $ocLazyLoad.load([
                                          'css/content-css/tree/tree.css',
                                          'js/services/security/authorize.js',
                                          'js/controllers/security/authorize.js'
                                      ]);
                                  }
                              );
                          }]
                  }
              })
              .state('app.function', {
                  url: '/security/function',
                  templateUrl: 'tpl/security/function.html',
                  resolve: {
                      deps: ['$ocLazyLoad',
                          function ($ocLazyLoad) {
                              return $ocLazyLoad.load('angularBootstrapNavTree').then(
                                  function(){
                                      return $ocLazyLoad.load([
                                          'js/services/security/function.js',
                                          'js/controllers/security/function.js'
                                      ]);
                                  }
                              );
                          }]
                  }
              })

              //orders
              .state('app.detail',{
                  url:'/orders/detail',
                  templateUrl:'tpl/orders/detail.html',
                  resolve: {
                      deps: ['$ocLazyLoad',
                          function( $ocLazyLoad ){
                              return $ocLazyLoad.load('ui.select').then(
                                  function(){
                                      return $ocLazyLoad.load([
                                          'js/services/orders/orders.js',
                                          'js/controllers/orders/orders.js']);
                                  }
                              );
                          }]
                  }
              })

              .state('app.all',{
                  url:'/orders/all',
                  templateUrl:'tpl/orders/all.html',
                  resolve: {
                      deps: ['$ocLazyLoad',
                          function ($ocLazyLoad) {
                              return $ocLazyLoad.load([
                                  'js/services/orders/orders.js',
                                  'js/controllers/orders/orders.js']);
                          }]
                  }
              })
              .state('app.ordersGoodsView',{
                  url:'/orders/goods/view/:id',
                  templateUrl:'tpl/orders/orders_detail.html',
                  resolve: {
                      deps: ['$ocLazyLoad',
                          function ($ocLazyLoad) {
                              return $ocLazyLoad.load([
                                  'css/content-css/orders/orders_detail.css',
                                  'js/services/orders/orders.js',
                                  'js/controllers/orders/orders.js']);
                          }]
                  }
              })

              //.state('app.ordersDetail',{
              //    url:'/orders/detail/:id',
              //    templateUrl:'tpl/orders/orders_detail.html',
              //    resolve: {
              //        deps: ['$ocLazyLoad',
              //            function ($ocLazyLoad) {
              //                return $ocLazyLoad.load([
              //
              //                    'css/content-css/orders/orders_detail.css',
              //                ]);
              //            }]
              //    }
              //})

              .state('app.ordersPriceChange',{
                  url:'/orders/price/change/:id',
                  templateUrl:'tpl/orders/orders_price_change.html',
                  resolve: {
                      deps: ['$ocLazyLoad',
                          function ($ocLazyLoad) {
                              return $ocLazyLoad.load([
                                  'js/services/orders/orders.js',
                                  'js/controllers/orders/orders.js']);
                          }]
                  }
              })


              .state('app.cancel',{
                  url:'/orders/cancel',
                  templateUrl:'tpl/orders/cancel.html',
                  resolve: {
                      deps: ['$ocLazyLoad',
                          function ($ocLazyLoad) {
                              return $ocLazyLoad.load([
                                  'js/services/orders/orders.js',
                                  'js/controllers/orders/orders.js']);
                          }]
                  }
              })
              .state('app.confirm',{
                  url:'/orders/confirm',
                  templateUrl:'tpl/orders/confirm.html',
                  resolve: {
                      deps: ['$ocLazyLoad',
                          function ($ocLazyLoad) {
                              return $ocLazyLoad.load([
                                  'js/services/orders/orders.js',
                                  'js/controllers/orders/orders.js']);
                          }]
                  }
              })
              .state('app.complete',{
                  url:'/orders/complete',
                  templateUrl:'tpl/orders/complete.html',
                  resolve: {
                      deps: ['$ocLazyLoad',
                          function ($ocLazyLoad) {
                              return $ocLazyLoad.load([
                                  'js/services/orders/orders.js',
                                  'js/controllers/orders/orders.js']);
                          }]
                  }
              })
              .state('app.wait',{
                  url:'/orders/wait',
                  templateUrl:'tpl/orders/wait.html',
                  resolve: {
                      deps: ['$ocLazyLoad',
                          function ($ocLazyLoad) {
                              return $ocLazyLoad.load([
                                  'js/services/orders/orders.js',
                                  'js/controllers/orders/orders.js']);
                          }]
                  }
              })
              .state('app.paid',{
                  url:'/orders/paid',
                  templateUrl:'tpl/orders/paid.html',
                  resolve: {
                      deps: ['$ocLazyLoad',
                          function( $ocLazyLoad ){
                              return $ocLazyLoad.load('ui.select').then(
                                  function(){
                                      return $ocLazyLoad.load([
                                          'js/services/orders/orders.js',
                                          'js/controllers/orders/orders.js']);
                                  }
                              );
                          }]
                  }

              })
              .state('app.shipped',{
                  url:'/orders/shipped',
                  templateUrl:'tpl/orders/shipped.html',
                  resolve: {
                      deps: ['$ocLazyLoad',
                          function ($ocLazyLoad) {
                              return $ocLazyLoad.load([
                                  'js/services/orders/orders.js',
                                  'js/controllers/orders/orders.js']);
                          }]
                  }
              })
              .state('app.waitUse',{
                  url:'/orders/wait/use',
                  templateUrl:'tpl/orders/wait_use.html',
                  resolve: {
                      deps: ['$ocLazyLoad',
                          function ($ocLazyLoad) {
                              return $ocLazyLoad.load([
                                  'js/services/orders/orders.js',
                                  'js/controllers/orders/orders.js']);
                          }]
                  }
              })
              .state('app.hasUse',{
                  url:'/orders/has/use',
                  templateUrl:'tpl/orders/has_use.html',
                  resolve: {
                      deps: ['$ocLazyLoad',
                          function ($ocLazyLoad) {
                              return $ocLazyLoad.load([
                                  'js/services/orders/orders.js',
                                  'js/controllers/orders/orders.js']);
                          }]
                  }
              })
              .state('app.fail',{
                  url:'/orders/fail',
                  templateUrl:'tpl/orders/fail.html',
                  resolve: {
                      deps: ['$ocLazyLoad',
                          function ($ocLazyLoad) {
                              return $ocLazyLoad.load([
                                  'js/services/orders/orders.js',
                                  'js/controllers/orders/orders.js']);
                          }]
                  }
              })
              .state('app.failin',{
                  url:'/orders/failin',
                  templateUrl:'tpl/orders/failin.html',
                  resolve: {
                      deps: ['$ocLazyLoad',
                          function ($ocLazyLoad) {
                              return $ocLazyLoad.load([
                                  'js/services/orders/orders.js',
                                  'js/controllers/orders/orders.js']);
                          }]
                  }
              })
              .state('app.deliveryUpdate',{
                  url:'/orders/deliveryUpdate/:id',
                  templateUrl:'tpl/orders/delivery_update.html',
                  resolve: {
                      deps: ['$ocLazyLoad',
                          function ($ocLazyLoad) {
                              return $ocLazyLoad.load([
                                  'js/services/orders/orders.js',
                                  'js/controllers/orders/orders.js']);
                          }]
                  }
              })

              .state('app.check',{
                  url:'/orders/check/:auth',
                  templateUrl:'tpl/orders/check.html',
                  cache:true,
                  resolve: {
                      deps: ['$ocLazyLoad',
                          function ($ocLazyLoad) {
                              return $ocLazyLoad.load([
                                  'js/services/orders/check.js',
                                  'js/controllers/orders/check.js',
                                  'css/content-css/orders/check.css'
                              ]);
                          }]
                  }
              })

              .state('app.ordersRefund', {
                  url: '/orders/orders/refund',
                  templateUrl: 'tpl/orders/orders_refund.html',
                  resolve: {
                      deps: ['$ocLazyLoad',
                          function ($ocLazyLoad) {
                              return $ocLazyLoad.load([
                                  'js/services/orders/refund.js',
                                  'js/controllers/orders/refund.js']);
                          }]
                  }
              })
              .state('app.ordersRefundFail', {
                  url: '/orders/orders/refund/:id',
                  templateUrl: 'tpl/orders/shop_refund_money_fail.html',
                  resolve: {
                      deps: ['$ocLazyLoad',
                          function ($ocLazyLoad) {
                              return $ocLazyLoad.load([
                                  'js/services/orders/refund.js',
                                  'js/controllers/orders/refund.js']);
                          }]
                  }
              })
              .state('app.goodsRefund', {
                  url: '/orders/goods/refund/:id',
                  templateUrl: 'tpl/orders/goods_refund.html',
                  resolve: {
                      deps: ['$ocLazyLoad',
                          function ($ocLazyLoad) {
                              return $ocLazyLoad.load([
                                  'js/services/orders/refund.js',
                                  'js/controllers/orders/refund.js']);
                          }]
                  }
              })

              .state('app.user',{
                  url:'/user/all',
                  templateUrl:'tpl/user/user.html',
                  resolve: {
                      deps: ['uiLoad',
                          function (uiLoad) {
                              return uiLoad.load([ 'js/services/user/user.js',
                                                    'js/controllers/user/user.js']);
                          }]
                  }
              })

              .state('app.userCoupons',{
                  url:'/user/coupons/:userId',
                  templateUrl:'tpl/user/user_coupons_give.html',
                  resolve: {
                      deps: ['uiLoad',
                          function (uiLoad) {
                              return uiLoad.load(['js/controllers/user/user_coupons_give.js',
                                  'js/services/user/user_coupons_give.js']);
                          }]
                  }
              })

              //data
              .state('app.ordersData',{
                  url:'/data/orders',
                  templateUrl:'tpl/data/orders_data_history.html',
                  resolve: {
                      deps: ['uiLoad',
                          function (uiLoad) {
                              return uiLoad.load(['js/controllers/data/data_history.js',
                                  'js/services/data/data_history.js']);
                          }]
                  }
              })

              .state('app.goodsData',{
                  url:'/data/goods/:id',
                  templateUrl:'tpl/data/goods_data_history.html',
                  resolve: {
                      deps: ['uiLoad',
                          function (uiLoad) {
                              return uiLoad.load(['js/controllers/data/data_history.js',
                                  'js/services/data/data_history.js']);
                          }]
                  }
              })

              //shop
              .state("app.shopDetailInfo",{
                  url:'/shop/shopDetailInfo',
                  templateUrl:'tpl/shop/shop_detail_Info.html'
              })
              .state("app.shopDetailPictures",{
                  url:'/shop/shopDetailPictures',
                  templateUrl:'tpl/shop/shop_detail_pictures.html'
              })
              .state("app.shopDetailInfoEdit",{
                  url:'/shop/shopDetailInfoEdit',
                  templateUrl:'tpl/shop/shop_detail_info_edit.html'
              })
              .state("app.shopDetailPicturesEdit",{
                  url:'/shop/shopDetailPicturesEdit',
                  templateUrl:'tpl/shop/shop_detail_pictures_edit.html'
              })

              //shopdetailEvaluate
              .state("app.shopDetailevaluate",{
                  url:'/shop/shopDetailevaluate',
                  templateUrl:'tpl/shop/shop_detail_evaluate.html'
              })
              .state("app.shopDetailevaluateInfo",{
                  url:'/shop/shopDetailevaluateInfo',
                  templateUrl:'tpl/shop/shop_detail_evaluateInfo.html'
              })

              //shopNotice
              .state("app.shopNotice",{
                  url:'/shop/shopNotice',
                  templateUrl:'tpl/shop/shop_notice.html'
              })
              .state("app.shopNoticeAdd",{
                  url:'/shop/shopNoticeAdd',
                  templateUrl:'tpl/shop/shop_notice_add.html'
              })

              //shopPrint
              .state("app.shopPrintSetting",{
                  url:'/shop/shopPrintSetting',
                  templateUrl:'tpl/shop/shop_print_setting.html'
              })

              //chain
              .state("app.chain",{
                  url:'/chain/view',
                  templateUrl:'tpl/chain/view.html',
                  resolve: {
                      deps: ['uiLoad',
                          function (uiLoad) {
                              return uiLoad.load([
                                  'js/services/chain/chain.js',
                                  'js/controllers/chain/chain.js',
                              ]);
                          }
                      ]
                  }
              })

              .state("app.chainAuditFail",{
                  url:'/chain/audit/fail/:id',
                  templateUrl:'tpl/chain/audit_fail.html',
                  resolve: {
                      deps: ['uiLoad',
                          function (uiLoad) {
                              return uiLoad.load([ 'js/services/chain/chain.js',
                                  'js/controllers/chain/chain.js']);
                          }]
                  }
              })

              .state("app.chainEdit",{
                  url:'/chain/edit/:chainId',
                  templateUrl:'tpl/chain/chain_edit.html',
                  resolve: {
                      deps: ['$ocLazyLoad',
                          function ($ocLazyLoad) {
                              return $ocLazyLoad.load([
                                  'js/services/chain/chain.js',
                                  'js/controllers/chain/chain.js']);
                          }]
                  }
              })


              .state("app.chainView",{
                  url:'/chain/view/:chainId',
                  templateUrl:'tpl/chain/chain_info.html',
                  resolve: {
                      deps: ['uiLoad',
                          function (uiLoad) {
                              return uiLoad.load([
                                  'js/services/chain/chain.js',
                                  'js/controllers/chain/chain.js',]);
                          }]
                  }
              })

              .state("app.chainShop",{
                  url:'/chain/shop/:chainId',
                  templateUrl:'tpl/chain/chain_shop.html',
                  resolve: {
                      deps: ['uiLoad',
                          function (uiLoad) {
                              return uiLoad.load([
                                  'js/services/chain/chain.js',
                                  'js/controllers/chain/chain.js'
                                  //'js/services/systemSetting/merchants.js',
                                  //'js/controllers/systemSetting/merchants.js'
                              ]);
                          }]
                  }
              })

              .state("app.chainShopEdit",{
                  url:'/chain/shop/edit/:shopId',
                  templateUrl:'tpl/chain/chain_shop_edit.html',
                  resolve: {
                      deps: ['uiLoad',
                          function (uiLoad) {
                              return uiLoad.load(['css/content-css/systemSetting/merchants_add.css',
                                  'css/content-css/goods/goods_detail_pictures.css',
                                  'js/services/systemSetting/merchants.js',
                                  'js/controllers/systemSetting/merchants.js']);
                          }]
                  }
              })

              .state("app.chainGoodsAudit",{
                  url:'/chainGoodsAudit/:chainId',
                  templateUrl:'tpl/chain/chain_goods_audit.html',
                  resolve: {
                      deps: ['$ocLazyLoad',
                          function ($ocLazyLoad) {
                              return $ocLazyLoad.load([
                                  'js/services/chain/goods_audit.js',
                                  'js/controllers/chain/goods_audit.js'
                              ]);
                          }
                      ]
                  }
              })

              .state("app.chainGoodsAuditInfo",{
                  url:'/chainGoodsAuditInfo/:id',
                  templateUrl:'tpl/chain/chain_goods_detail.html',
                  resolve: {
                      deps: ['$ocLazyLoad',
                          function ($ocLazyLoad) {
                              return $ocLazyLoad.load([
                                  'css/content-css/goods/goods_detail.css',
                                  'js/services/chain/chain_goods_detail.js',
                                  'js/controllers/chain/chain_goods_detail.js',
                              ]);
                          }
                      ]
                  }
              })

              .state("app.chainGoodsManageSoldOut",{
                  url:'/chain/goods/manage/sold/out/:id',
                  templateUrl:'tpl/chain/chain_goods_manage_sold_out.html',
                  resolve: {
                      deps: ['uiLoad',
                          function (uiLoad) {
                              return uiLoad.load([ 'js/services/chain/chain_goods_manage.js',
                                  'js/controllers/chain/chain_goods_manage.js']);
                          }]
                  }
              })

              //brands
              .state('app.brands',{
                  url:'/brands/brands',
                  templateUrl:'tpl/brands/brands.html'
              })
              .state("app.brandsDetailInfoAdd",{
                  url:'/brands/brandsDetailInfoAdd',
                  templateUrl:'tpl/brands/brands_detail_info_add.html'
              })
              .state("app.brandsDetailPicturesAdd",{
                  url:'/brands/brandsDetailPicturesAdd',
                  templateUrl:'tpl/brands/brands_detail_pictures_add.html'
              })
              .state("app.brandsDetailInfoEdit",{
                  url:'/brands/brandsDetailInfoEdit',
                  templateUrl:'tpl/brands/brands_detail_info_edit.html'
              })
              .state("app.brandsDetailPicturesEdit",{
                  url:'/brands/brandsDetailPicturesEdit',
                  templateUrl:'tpl/brands/brands_detail_pictures_edit.html'
              })
              .state("app.brandsDetailInfo",{
                  url:'/brands/brandsDetailInfo',
                  templateUrl:'tpl/brands/brands_detail_info.html'
              })
              .state("app.brandsDetailPictures",{
                  url:'/brands/brandsDetailPictures',
                  templateUrl:'tpl/brands/brands_detail_pictures.html'
              })

              //goods
              .state("app.goods",{
                  url:'/goods/goods',
                  templateUrl:'tpl/goods/goods.html'
              })
              .state("app.goodsDetailInfo",{
                  url:'/goods/goodsDetailInfo',
                  templateUrl:'tpl/goods/goods_detail_Info.html'
              })
              .state("app.goodsDetailInfoEdit",{
                  url:'/goods/goodsDetailInfoEdit',
                  templateUrl:'tpl/goods/goods_detail_info_edit.html'
              })
              .state("app.goodsDetailInfoAdd",{
                  url:'/goods/goodsDetailInfoAdd',
                  templateUrl:'tpl/goods/goods_detail_info_add.html'
              })
              .state("app.goodsDetailSku",{
                  url:'/goods/goodsDetailSku',
                  templateUrl:'tpl/goods/goods_detail_sku.html',
                  resolve: {
                      deps: ['uiLoad',
                          function (uiLoad) {
                              return uiLoad.load(['css/content-css/goods/goods_detail_sku.css']);
                          }]
                  }
              })
              .state("app.goodsDetailSkuEdit",{
                  url:'/goods/goodsDetailSkuEdit',
                  templateUrl:'tpl/goods/goods_detail_sku_edit.html',
                  resolve: {
                      deps: ['uiLoad',
                          function (uiLoad) {
                              return uiLoad.load(['css/content-css/goods/goods_detail_sku_edit.css']);
                          }]
                  }
              })
              .state("app.goodsDetailSkuAdd",{
                  url:'/goods/goodsDetailSkuAdd',
                  templateUrl:'tpl/goods/goods_detail_sku_add.html',
                  resolve: {
                      deps: ['uiLoad',
                          function (uiLoad) {
                              return uiLoad.load(['css/content-css/goods/goods_detail_sku_add.css']);
                          }]
                  }
              })

              .state('app.goodsDetailPictures',{
                  url:'/goods/goodsDetailPictures',
                  templateUrl:'tpl/goods/goods_detail_pictures.html',
                  resolve: {
                      deps: ['uiLoad',
                          function (uiLoad) {
                              return uiLoad.load(['css/content-css/goods/goods_detail_pictures.css']);
                          }]
                  }
              })
              .state('app.goodsDetailPicturesEdit',{
                  url:'/goods/goodsDetailPicturesEdit',
                  templateUrl:'tpl/goods/goods_detail_pictures_edit.html',
                  resolve: {
                      deps: ['uiLoad',
                          function (uiLoad) {
                              return uiLoad.load(['css/content-css/goods/goods_detail_pictures_edit.css']);
                          }]
                  }
              })
              .state("app.goodsDetailPicturesAdd",{
                  url:'/goods/goodsDetailPicturesAdd',
                  templateUrl:'tpl/goods/goods_detail_pictures_add.html',
                  resolve: {
                      deps: ['uiLoad',
                          function (uiLoad) {
                              return uiLoad.load(['css/content-css/goods/goods_detail_pictures_add.css']);
                          }]
                  }
              })



              //goods-type
              .state("app.goodsType",{
                  url:'/goods/goodsType',
                  templateUrl:'tpl/goods/goods_type.html',
                  resolve: {
                      deps: ['uiLoad',
                          function (uiLoad) {
                              return uiLoad.load(['css/content-css/goods/goods_type.css']);
                          }]
                  }
              })

              //goods-evaluate
              .state("app.goodsDetailevaluate",{
                  url:'/goods/goodsDetailevaluate',
                  templateUrl:'tpl/goods/goods_detail_evaluate.html'
              })
              .state("app.goodsDetailevaluateInfo",{
                  url:'/goods/goodsDetailevaluateInfo',
                  templateUrl:'tpl/goods/goods_detail_evaluateInfo.html'
              })


              //sku
              .state("app.sku",{
                  url:'/sku/sku',
                  templateUrl:'tpl/sku/sku.html'
              })
              .state("app.skuDetailInfo",{
                  url:'/sku/sku',
                  templateUrl:'tpl/sku/sku_detail_info.html'
              })


              //question
              .state("app.question",{
                  url:'/question/question',
                  templateUrl:'tpl/question/question.html',
                  resolve: {
                      deps: ['uiLoad',
                          function (uiLoad) {
                              return uiLoad.load([
                                  'js/services/question/question.js',
                                  'js/controllers/question/question.js',
                              ]);
                          }
                      ]
                  }
              })

              .state("app.questionDetailInfo",{
                  url:'/question/questionDetailInfo/:id',
                  templateUrl:'tpl/question/question_detail_info.html',
                  resolve: {
                      deps: ['uiLoad',
                          function (uiLoad) {
                              return uiLoad.load([
                                  'js/services/question/question.js',
                                  'js/controllers/question/question.js',
                              ]);
                          }
                      ]
                  }
              })

              .state("app.questionEdit",{
                  url:'/question/questionDetailInfoEdit:id',
                  templateUrl:'tpl/question/question_edit.html',
                  resolve: {
                      deps: ['$ocLazyLoad',
                          function( uiLoad){
                              return uiLoad.load([
                                  'js/services/question/question.js',
                                  'js/controllers/question/question.js',
                              ]);
                          }
                      ]
                  }
              })

              .state("app.questionAdd",{
                  url:'/question/questionAdd',
                  templateUrl:'tpl/question/question_add.html',
                  resolve: {
                      deps: ['$ocLazyLoad',
                          function( uiLoad){
                              return uiLoad.load([
                                  'js/services/question/question.js',
                                  'js/controllers/question/question.js',
                              ]);
                          }
                      ]
                  }
              })
              .state('app.questionType',{
                  url:'/questionType',
                  templateUrl:'tpl/question/question_type.html',
                  resolve: {
                      deps: ['uiLoad',
                          function (uiLoad) {
                              return uiLoad.load([
                                  'js/services/question/question_type.js',
                                  'js/controllers/question/question_type.js'
                              ]);
                          }
                      ]
                  }
              })

              //advertisement
              .state("app.advertisement",{
                  url:'/advertisement/advertisement',
                  templateUrl:'tpl/advertisement/advertisement.html',
                  resolve: {
                      deps: ['uiLoad',
                          function (uiLoad) {
                              return uiLoad.load([
                                  'js/services/advertisement/advertisement.js',
                                  'js/controllers/advertisement/advertisement.js',
                              ]);
                          }
                      ]
                  }
              })
              .state("app.advertisementDetailInfo",{
                  url:'/advertisement/advertisementDetailInfo/:id',
                  templateUrl:'tpl/advertisement/advertisement_detail_info.html',
                  resolve: {
                      deps: ['uiLoad',
                          function (uiLoad) {
                              return uiLoad.load([
                                  'js/services/advertisement/advertisement.js',
                                  'js/controllers/advertisement/advertisement.js',
                              ]);
                          }
                      ]
                  }
              })
              .state("app.advertisementDetailInfoEdit",{
                  url:'/advertisement/advertisementDetailInfoEdit:id',
                  templateUrl:'tpl/advertisement/advertisement_detail_info_edit.html',
                  resolve: {
                      deps: ['$ocLazyLoad',
                          function( $ocLazyLoad){
                              return $ocLazyLoad.load('angularFileUpload').then(
                                  function(){
                                      return $ocLazyLoad.load([
                                          'css/content-css/upload/picture_upload.css',
                                          'js/services/advertisement/advertisement.js',
                                          'js/controllers/advertisement/advertisement.js'
                                      ]);
                                  }
                              );
                          }
                      ]
                  }
              })
              .state("app.advertisementDetailInfoAdd",{
                  url:'/advertisement/advertisementDetailInfoAdd',
                  templateUrl:'tpl/advertisement/advertisement_detail_info_add.html',
                  resolve: {
                      deps: ['$ocLazyLoad',
                          function( $ocLazyLoad){
                              return $ocLazyLoad.load('angularFileUpload').then(
                                  function(){
                                      return $ocLazyLoad.load([
                                          'css/content-css/upload/picture_upload.css',
                                          'js/services/advertisement/advertisement.js',
                                          'js/controllers/advertisement/advertisement.js'
                                      ]);
                                  }
                              );
                          }]
                  }
              })
              .state("app.advertisementDetailPicturesEdit",{
                  url:'/advertisement/advertisementDetailPicturesEdit',
                  templateUrl:'tpl/advertisement/advertisement_detail_pictures_edit.html'
              })

              .state('app.advertisementType',{
                  url:'/advertisementType',
                  templateUrl:'tpl/advertisement/advertisement_type.html',
                  resolve: {
                      deps: ['uiLoad',
                          function (uiLoad) {
                              return uiLoad.load([
                                  'js/services/advertisement/advertisement_type.js',
                                  'js/controllers/advertisement/advertisement_type.js'
                              ]);
                          }
                      ]
                  }
              })

              //coupons
              .state('app.coupons',{
                  url:'/coupons',
                  templateUrl:'tpl/coupons/coupons.html',
                  resolve: {
                      deps: ['uiLoad',
                          function (uiLoad) {
                              return uiLoad.load(['js/controllers/coupons/coupons.js','js/services/coupons/coupons.js']);
                          }]
                  }
              })
              .state('app.couponsDetailAdd',{
                  url:'/coupons/detail/add',
                  templateUrl:'tpl/coupons/coupons_detail_add.html',
                  resolve: {
                      deps: ['uiLoad',
                          function (uiLoad) {
                              return uiLoad.load(['js/controllers/coupons/coupons_detail_add.js','js/services/coupons/coupons_detail_add.js']);
                          }]
                  }
              })
              .state('app.couponsDetailEdit',{
                  url:'/coupons/detail/edit/:id',
                  templateUrl:'tpl/coupons/coupons_detail_edit.html',
                  resolve: {
                      deps: ['uiLoad',
                          function (uiLoad) {
                              return uiLoad.load(['js/controllers/coupons/coupons_detail_edit.js','js/services/coupons/coupons_detail_edit.js']);
                          }]
                  }
              })

              //notice
              .state('app.notice',{
                  url:'/notice',
                  templateUrl:'tpl/notice/notice.html',
                  resolve: {
                      deps: ['uiLoad',
                          function (uiLoad) {
                              return uiLoad.load([
                                  'js/controllers/notice/notice.js',
                                  'js/services/notice/notice.js'
                              ]);
                          }
                      ]
                  }
              })
              .state('app.noticeAdd',{
                  url:'/notice/add',
                  templateUrl:'tpl/notice/notice_add.html',
                  resolve: {
                      deps: ['uiLoad',
                          function (uiLoad) {
                              return uiLoad.load([
                                  'js/controllers/notice/notice.js',
                                  'js/services/notice/notice.js'
                              ]);
                          }
                      ]
                  }
              })
              .state('app.noticeDetail',{
                  url:'/notice/detail/:id',
                  templateUrl:'tpl/notice/notice_detail.html',
                  resolve: {
                      deps: ['uiLoad',
                          function (uiLoad) {
                              return uiLoad.load([
                                  'js/controllers/notice/notice.js',
                                  'js/services/notice/notice.js'
                              ]);
                          }
                      ]
                  }
              })
              .state('app.noticeEdit',{
                  url:'/notice/edit/:id',
                  templateUrl:'tpl/notice/notice_edit.html',
                  resolve: {
                      deps: ['uiLoad',
                          function (uiLoad) {
                              return uiLoad.load([
                                  'js/controllers/notice/notice.js',
                                  'js/services/notice/notice.js'
                              ]);
                          }
                      ]
                  }
              })
              //mobilePhoneWhite
              .state('app.mobilePhoneWhite',{
                  url:'/mobile/phone/white',
                  templateUrl:'tpl/systemSetting/mobile_phone_white_view.html',
                  resolve: {
                      deps: ['$ocLazyLoad',
                          function ($ocLazyLoad) {
                              return $ocLazyLoad.load([
                                  'js/services/mobile_phone_white/mobile_phone_white.js',
                                  'js/controllers/mobile_phone_white/mobile_phone_white.js'
                              ]);
                          }
                      ]
                  }
              })
              .state("app.benefit",{
                  url:'/benefit',
                  templateUrl:'tpl/systemSetting/benefit.html',
                  resolve: {
                      deps: ['$ocLazyLoad',
                          function ($ocLazyLoad) {
                              return $ocLazyLoad.load([
                                  'js/services/systemSetting/benefit.js',
                                  'js/controllers/systemSetting/benefit.js'
                              ]);
                          }
                      ]
                  }
              })
              .state("app.benefitAdd",{
                  url:'/benefit/add',
                  templateUrl:'tpl/systemSetting/benefit_add.html',
                  resolve: {
                      deps: ['$ocLazyLoad',
                          function ($ocLazyLoad) {
                              return $ocLazyLoad.load([
                                  'js/services/systemSetting/benefit.js',
                                  'js/controllers/systemSetting/benefit.js'
                              ]);
                          }
                      ]
                  }
              })
              .state("app.benefitEdit",{
                  url:'/benefit/edit/:id',
                  templateUrl:'tpl/systemSetting/benefit_edit.html',
                  resolve: {
                      deps: ['$ocLazyLoad',
                          function ($ocLazyLoad) {
                              return $ocLazyLoad.load([
                                  'js/services/systemSetting/benefit.js',
                                  'js/controllers/systemSetting/benefit.js'
                              ]);
                          }
                      ]
                  }
              })
              .state("app.rebateGoods",{
                  url:'/rebateGoods',
                  templateUrl:'tpl/systemSetting/rebate_goods.html',
                  resolve: {
                      deps: ['$ocLazyLoad',
                          function ($ocLazyLoad) {
                              return $ocLazyLoad.load([
                                  'js/services/systemSetting/rebate_goods.js',
                                  'js/controllers/systemSetting/rebate_goods.js'
                              ]);
                          }
                      ]
                  }
              })
              .state("app.rebateGoodsAdd",{
                  url:'/rebateGoods/add',
                  templateUrl:'tpl/systemSetting/rebate_goods_add.html',
                  resolve: {
                      deps: ['$ocLazyLoad',
                          function ($ocLazyLoad) {
                              return $ocLazyLoad.load([
                                  'js/services/systemSetting/rebate_goods.js',
                                  'js/controllers/systemSetting/rebate_goods.js',
                              ]);
                          }
                      ]
                  }
              })

              .state("app.rebateGoodsEdit",{
                  url:'/rebateGoods/edit/:id',
                  templateUrl:'tpl/systemSetting/rebate_goods_edit.html',
                  resolve: {
                      deps: ['$ocLazyLoad',
                          function ($ocLazyLoad) {
                              return $ocLazyLoad.load([
                                  'js/services/systemSetting/rebate_goods.js',
                                  'js/controllers/systemSetting/rebate_goods.js'
                              ]);
                          }
                      ]
                  }
              })

              .state("app.distribution",{
                  url:'/distribution',
                  templateUrl:'tpl/systemSetting/distribution.html',
                  resolve: {
                      deps: ['uiLoad',
                          function (uiLoad) {
                              return uiLoad.load([ 'js/services/systemSetting/distribution.js',
                                  'js/controllers/systemSetting/distribution.js']);
                          }]
                  }
              })
              .state("app.merchants",{
                  url:'/merchants',
                  templateUrl:'tpl/systemSetting/merchants.html',
                  resolve: {
                      deps: ['uiLoad',
                          function (uiLoad) {
                              return uiLoad.load([ 'js/services/systemSetting/merchants.js',
                                                   'js/controllers/systemSetting/merchants.js']);
                          }]
                  }
              })

              .state("app.merchantsAuditFail",{
                  url:'/merchants/audit/fail/:id',
                  templateUrl:'tpl/systemSetting/audit_fail.html',
                  resolve: {
                      deps: ['uiLoad',
                          function (uiLoad) {
                              return uiLoad.load([ 'js/services/systemSetting/merchants.js',
                                  'js/controllers/systemSetting/merchants.js']);
                          }]
                  }
              })

              .state("app.merchantsGoods",{
                  url:'/merchantsGoods/:shopId',
                  templateUrl:'tpl/systemSetting/merchants_goods.html',
                  resolve: {
                      deps: ['uiLoad',
                          function (uiLoad) {
                              return uiLoad.load(['js/services/systemSetting/merchants_goods.js',
                                  'js/controllers/systemSetting/merchants_goods.js']);
                          }]
                  }
              })
              .state("app.merchantsEdit",{
                  url:'/merchants/edit/:shopId',
                  templateUrl:'tpl/systemSetting/merchants_edit.html',
                  resolve: {
                      deps: ['uiLoad',
                          function (uiLoad) {
                              return uiLoad.load(['css/content-css/systemSetting/merchants_add.css',
                                                'css/content-css/goods/goods_detail_pictures.css',
                                              'js/services/systemSetting/merchants.js',
                                              'js/controllers/systemSetting/merchants.js']);
                          }]
                  }
              })

              .state("app.merchantsView",{
                  url:'/merchants/view/:shopId',
                  templateUrl:'tpl/systemSetting/merchants_view.html',
                  resolve: {
                      deps: ['uiLoad',
                          function (uiLoad) {
                              return uiLoad.load([
                                  'js/services/systemSetting/merchants.js',
                                  'js/controllers/systemSetting/merchants.js']);
                          }]
                  }
              })

              .state("app.goodsAudit",{
                  url:'/goodsAudit',
                  templateUrl:'tpl/systemSetting/goods_audit.html',
                  resolve: {
                      deps: ['$ocLazyLoad',
                          function ($ocLazyLoad) {
                              return $ocLazyLoad.load([
                                  'js/services/goods_audit/goods_audit.js',
                                  'js/controllers/goods_audit/goods_audit.js'
                              ]);
                          }
                      ]
                  }
              })

              .state("app.programGoodsManage",{
                  url:'/program/goods/manage',
                  templateUrl:'tpl/goods/program_goods_manage.html',
                  resolve: {
                      deps: ['$ocLazyLoad',
                          function ($ocLazyLoad) {
                              return $ocLazyLoad.load([
                                  'js/services/goods/program_goods_manage.js',
                                  'js/controllers/goods/program_goods_manage.js'
                              ]);
                          }
                      ]
                  }
              })


              .state("app.batchGoodsAuditFail",{
                  url:'/goodsAudit/batch/audit/fail',
                  templateUrl:'tpl/systemSetting/batch_goods_audit_fail.html',
                  resolve: {
                      deps: ['uiLoad',
                          function (uiLoad) {
                              return uiLoad.load([ 'js/services/goods_audit/goods_audit.js',
                                  'js/controllers/goods_audit/goods_audit.js']);
                          }]
                  }
              })
              .state("app.goodsSoldOut",{
                  url:'/merchants/goods/sold/out/:id',
                  templateUrl:'tpl/systemSetting/merchants_goods_sold_out.html',
                  resolve: {
                      deps: ['uiLoad',
                          function (uiLoad) {
                              return uiLoad.load([ 'js/services/systemSetting/merchants_goods.js',
                                  'js/controllers/systemSetting/merchants_goods.js']);
                          }]
                  }
              })

              .state("app.goodsAuditFail",{
                  url:'/goodsAudit/batch/audit/fail/:id',
                  templateUrl:'tpl/systemSetting/goods_audit_fail.html',
                  resolve: {
                      deps: ['uiLoad',
                          function (uiLoad) {
                              return uiLoad.load([ 'js/services/goods_audit/goods_audit.js',
                                  'js/controllers/goods_audit/goods_audit.js']);
                          }]
                  }
              })

              //.state("app.goodsAuditInfo",{
              //    url:'/goodsAuditInfo/:id',
              //    templateUrl:'tpl/systemSetting/goods_audit_info.html',
              //    resolve: {
              //        deps: ['$ocLazyLoad',
              //            function ($ocLazyLoad) {
              //                return $ocLazyLoad.load([
              //                    'js/services/goods_audit/goods_audit_info.js',
              //                    'js/controllers/goods_audit/goods_audit_info.js',
              //                ]);
              //            }
              //        ]
              //    }
              //})

              .state("app.goodsAuditInfo",{
                  url:'/goodsAuditInfo/:id',
                  templateUrl:'tpl/goods/goods_detail.html',
                  resolve: {
                      deps: ['$ocLazyLoad',
                          function ($ocLazyLoad) {
                              return $ocLazyLoad.load([
                                  'css/content-css/goods/goods_detail.css',
                                  'js/services/goods/goods_detail.js',
                                  'js/controllers/goods/goods_detail.js',
                              ]);
                          }
                      ]
                  }
              })


              .state("app.goodsAuditSku",{
                  url:'/goodsAuditSku',
                  templateUrl:'tpl/systemSetting/goods_audit_sku.html',
                  resolve: {
                      deps: ['uiLoad',
                          function (uiLoad) {
                              return uiLoad.load(['css/content-css/goods/goods_detail_sku.css']);
                          }]
                  }
              })
              .state("app.goodsAuditPictures",{
                  url:'/goodsAuditPictures',
                  templateUrl:'tpl/systemSetting/goods_audit_pictures.html',
                  resolve: {
                      deps: ['uiLoad',
                          function (uiLoad) {
                              return uiLoad.load(['css/content-css/goods/goods_detail_pictures.css']);
                          }]
                  }
              })
              .state("app.industry",{
                  url:'/industry',
                  templateUrl:'tpl/systemSetting/industry.html',
                  resolve: {
                      deps: ['$ocLazyLoad',
                          function ($ocLazyLoad) {
                              return $ocLazyLoad.load([
                                  'js/services/systemSetting/industry.js',
                                  'js/controllers/systemSetting/industry.js',
                                  'css/content-css/advertisement/advertisement_type.css']);
                          }]
                  }
              })
              .state("app.wechatConfig",{
                  url:'/wechatConfig',
                  templateUrl:'tpl/wechat/wechat_config.html',
                  resolve: {
                      deps: ['$ocLazyLoad',
                          function ($ocLazyLoad) {
                              return $ocLazyLoad.load([
                                  'js/services/wechatConfig/wechat_config.js',
                                  'js/controllers/wechatConfig/wechat_config.js',]);
                          }]
                  }
              })
              .state("app.wechatConfigView",{
                  url:'/wechat/config/view/:id',
                  templateUrl:'tpl/wechat/wechat_config_view.html',
                  resolve: {
                      deps: ['$ocLazyLoad',
                          function ($ocLazyLoad) {
                              return $ocLazyLoad.load([
                                  'js/services/wechatConfig/wechat_config.js',
                                  'js/controllers/wechatConfig/wechat_config.js']);
                          }]
                  }
              })
              .state("app.wechatConfigAdd",{
                  url:'/wechat/config/add',
                  templateUrl:'tpl/wechat/wechat_config_add.html',
                  resolve: {
                      deps: ['$ocLazyLoad',
                          function ($ocLazyLoad) {
                              return $ocLazyLoad.load([
                                  'js/services/wechatConfig/wechat_config.js',
                                  'js/controllers/wechatConfig/wechat_config.js',]);
                          }]
                  }
              })
              .state("app.wechatConfigEdit",{
                  url:'/wechat/config/edit/:id',
                  templateUrl:'tpl/wechat/wechat_config_edit.html',
                  resolve: {
                      deps: ['$ocLazyLoad',
                          function ($ocLazyLoad) {
                              return $ocLazyLoad.load([
                                  'js/services/wechatConfig/wechat_config.js',
                                  'js/controllers/wechatConfig/wechat_config.js']);
                          }]
                  }
              })

              .state("app.setMeal",{
                  url:'/set/meal',
                  templateUrl:'tpl/systemSetting/set_meal.html',
                  resolve: {
                      deps: ['$ocLazyLoad',
                          function ($ocLazyLoad) {
                              return $ocLazyLoad.load([
                                  'js/services/systemSetting/set_meal.js',
                                  'js/controllers/systemSetting/set_meal.js',
                                  ]);
                          }]
                  }
              })
              .state("app.setMealAdd",{
                  url:'/set/meal/add',
                  templateUrl:'tpl/systemSetting/set_meal_add.html',
                  resolve: {
                      deps: ['$ocLazyLoad',
                          function ($ocLazyLoad) {
                              return $ocLazyLoad.load([
                                  'js/services/systemSetting/set_meal.js',
                                  'js/controllers/systemSetting/set_meal.js',
                              ]);
                          }]
                  }
              })
              .state("app.setMealView",{
                  url:'/set/meal/view/:id',
                  templateUrl:'tpl/systemSetting/set_meal_view.html',
                  resolve: {
                      deps: ['$ocLazyLoad',
                          function ($ocLazyLoad) {
                              return $ocLazyLoad.load([
                                  'js/services/systemSetting/set_meal.js',
                                  'js/controllers/systemSetting/set_meal.js',
                              ]);
                          }]
                  }
              })

              .state("app.setMealEdit",{
                  url:'/set/meal/edit/:id',
                  templateUrl:'tpl/systemSetting/set_meal_edit.html',
                  resolve: {
                      deps: ['$ocLazyLoad',
                          function ($ocLazyLoad) {
                              return $ocLazyLoad.load([
                                  'js/services/systemSetting/set_meal.js',
                                  'js/controllers/systemSetting/set_meal.js',
                              ]);
                          }]
                  }
              })

              .state("app.logistics",{
                  url:'/logistics',
                  templateUrl:'tpl/systemSetting/logistics.html',
                  resolve: {
                      deps: ['$ocLazyLoad',
                          function ($ocLazyLoad) {
                              return $ocLazyLoad.load([
                                  'js/services/systemSetting/logistics.js',
                                  'js/controllers/systemSetting/logistics.js',
                              ]);
                          }]
                  }
              })

              .state("app.logisticsAdd",{
                  url:'/logistics/add',
                  templateUrl:'tpl/systemSetting/logistics_add.html',
                  resolve: {
                      deps: ['$ocLazyLoad',
                          function ($ocLazyLoad) {
                              return $ocLazyLoad.load([
                                  'js/services/systemSetting/logistics.js',
                                  'js/controllers/systemSetting/logistics.js',
                              ]);
                          }]
                  }
              })

              .state("app.logisticsEdit",{
                  url:'/logistics/edit/:id',
                  templateUrl:'tpl/systemSetting/logistics_edit.html',
                  resolve: {
                      deps: ['$ocLazyLoad',
                          function ($ocLazyLoad) {
                              return $ocLazyLoad.load([
                                  'js/services/systemSetting/logistics.js',
                                  'js/controllers/systemSetting/logistics.js'
                              ]);
                          }]
                  }
              })
              //.state("app.404",{
              //    url:'/404',
              //    templateUrl:'tpl/404.html'
              //})
              //.state("app.500",{
              //    url:'/500',
              //    templateUrl:'tpl/500.html'
              //})
              //property
              .state("app.property",{
                  url:'/property',
                  templateUrl:'tpl/property/property.html',
                  resolve: {
                      deps: ['$ocLazyLoad',
                          function ($ocLazyLoad) {
                              return $ocLazyLoad.load([
                                  'js/services/property/property.js',
                                  'js/controllers/property/property.js'
                              ]);
                          }]
                  }
              })

              .state("app.withdrawalFail",{
                  url:'/property/fail/:id',
                  templateUrl:'tpl/property/withdrawal_fail.html',
                  resolve: {
                      deps: ['$ocLazyLoad',
                          function ($ocLazyLoad) {
                              return $ocLazyLoad.load([
                                  'js/services/property/property.js',
                                  'js/controllers/property/property.js'
                              ]);
                          }]
                  }
              })

              //vip
              .state("app.vip",{
                  url:'/vip',
                  templateUrl:'tpl/vip/vip.html',
                  resolve: {
                      deps: ['$ocLazyLoad',
                          function ($ocLazyLoad) {
                              return $ocLazyLoad.load([
                                  'js/services/vip/vip.js',
                                  'js/controllers/vip/vip.js'
                              ]);
                          }]
                  }
              })

              .state("app.vipAdd",{
                  url:'/vip/add',
                  templateUrl:'tpl/vip/vip_add.html',
                  resolve: {
                      deps: ['$ocLazyLoad',
                          function ($ocLazyLoad) {
                              return $ocLazyLoad.load([
                                  'js/services/vip/vip.js',
                                  'js/controllers/vip/vip.js'
                              ]);
                          }]
                  }
              })

              .state("app.vipUpdate",{
                  url:'/vip/update/:id',
                  templateUrl:'tpl/vip/vip_update.html',
                  resolve: {
                      deps: ['$ocLazyLoad',
                          function ($ocLazyLoad) {
                              return $ocLazyLoad.load([
                                  'js/services/vip/vip.js',
                                  'js/controllers/vip/vip.js'
                              ]);
                          }]
                  }
              })

              //modules
              .state('app.modules', {
                  url: '/modules',
                  templateUrl: 'tpl/modules/modules.html',
                  resolve: {
                      deps: ['uiLoad',
                          function (uiLoad) {
                              return uiLoad.load([
                                  'js/controllers/modules/modules.js',
                                  'js/services/modules/modules.js'
                              ]);
                          }]
                  }

              })
              .state('app.modulesAdd',{
                  url:'/modules/add',
                  templateUrl:'tpl/modules/modules_add.html',
                  resolve: {
                      deps: ['uiLoad',
                          function (uiLoad) {
                              return uiLoad.load([
                                  'js/controllers/modules/modules_add.js',
                                  'js/services/modules/modules_add.js'
                              ]);
                          }]
                  }
              })
              .state('app.modulesEdit',{
                  url:'/modules/edit/:id',
                  templateUrl:'tpl/modules/modules_edit.html',
                  resolve: {
                      deps: ['uiLoad',
                          function (uiLoad) {
                              return uiLoad.load([
                                  'js/controllers/modules/modules_edit.js',
                                  'js/services/modules/modules_edit.js'
                              ]);
                          }]
                  }
              })
              .state('app.modulesGoods',{
                  url:'/modules/goods/:id',
                  templateUrl:'tpl/modules/modules_goods.html',
                  resolve: {
                      deps: ['uiLoad',
                          function (uiLoad) {
                              return uiLoad.load([
                                  'js/controllers/modules/modules_goods.js',
                                  'js/services/modules/modules_goods.js',
                              ]);
                          }]
                  }
              })
              .state('app.modulesShops',{
                  url:'/modules/shops/:modulesId',
                  templateUrl:'tpl/modules/modules_shops.html',
                  resolve:{
                      deps:['uiLoad',function(uiLoad){
                          return uiLoad.load([
                              'js/controllers/modules/modules_shops.js',
                              'js/services/modules/modules_shops.js',
                          ])
                      }]
                  }
              })
              .state('app.modulesAdvertisement',{
                  url:'/modules/advertisement/:modulesId',
                  templateUrl:'tpl/modules/modules_advertisement.html',
                  resolve: {
                      deps: ['uiLoad',
                          function (uiLoad) {
                              return uiLoad.load([
                                  'js/controllers/modules/modules_advertisement.js',
                                  'js/services/modules/modules_advertisement.js',
                              ]);
                          }]
                  }
              })
              .state('app.modulesAdvertisementAdd',{
                  url:'/modules/advertisement/add/:modulesId',
                  templateUrl:'tpl/modules/modules_advertisement_add.html',
                  resolve: {
                      deps: ['$ocLazyLoad',
                          function( $ocLazyLoad){
                              return $ocLazyLoad.load('angularFileUpload').then(
                                  function(){
                                      return $ocLazyLoad.load([
                                          'css/content-css/upload/picture_upload.css',
                                          'js/controllers/modules/modules_advertisement_add.js',
                                          'js/services/modules/modules_advertisement_add.js',
                                      ]);
                                  }
                              );
                          }]
                  }
              })

              .state('app.modulesAdvertisementEdit',{
                  url:'/modules/advertisement/edit/:id/:modulesId',
                  templateUrl:'tpl/modules/modules_advertisement_edit.html',
                  resolve: {
                      deps: ['$ocLazyLoad',
                          function( $ocLazyLoad){
                              return $ocLazyLoad.load('angularFileUpload').then(
                                  function(){
                                      return $ocLazyLoad.load([
                                          'css/content-css/upload/picture_upload.css',
                                          'js/controllers/modules/modules_advertisement_edit.js',
                                          'js/services/modules/modules_advertisement_edit.js',
                                      ]);
                                  }
                              );
                          }]
                  }
              })

              .state('app.modulesGoodsAdd',{
                  url:'/modules/goods/add/:id',
                  templateUrl:'tpl/modules/modules_goods_add.html',
                  resolve: {
                      deps: ['uiLoad',
                          function (uiLoad) {
                              return uiLoad.load([
                                  'js/controllers/modules/modules_goods_add.js',
                                  'js/services/modules/modules_goods_add.js',
                              ]);
                          }]
                  }
              })

              //column
              .state('app.column', {
                  url: '/column',
                  templateUrl: 'tpl/column/column.html',
                  resolve: {
                      deps: ['uiLoad',
                          function (uiLoad) {
                              return uiLoad.load([
                                  'js/controllers/column/column.js',
                                  'js/services/column/column.js',
                              ]);
                          }]
                  }
              })

              .state('app.columnAdd',{
                  url:'/column/add',
                  templateUrl:'tpl/column/column_add.html',
                  resolve: {
                      deps: ['uiLoad',
                          function (uiLoad) {
                              return uiLoad.load([
                                  'js/controllers/column/column_add.js',
                                  'js/services/column/column_add.js',
                              ]);
                          }]
                  }
              })

              .state('app.columnEdit',{
                  url:'/column/edit/:id',
                  templateUrl:'tpl/column/column_edit.html',
                  resolve: {
                      deps: ['uiLoad',
                          function (uiLoad) {
                              return uiLoad.load([
                                  'js/controllers/column/column_edit.js',
                                  'js/services/column/column_edit.js',
                              ]);
                          }]
                  }
              })
              //recharge Configure
              .state("app.rechargeConfigure",{
                url:'/recharge/configure',
                templateUrl:'tpl/recharge/recharge_configure.html',
                resolve: {
                    deps: ['$ocLazyLoad',
                        function ($ocLazyLoad) {
                            return $ocLazyLoad.load([
                                'js/services/recharge/recharge_configure.js',
                                'js/controllers/recharge/recharge_configure.js'
                            ]);
                        }
                    ]
                }
            })
            .state("app.rechargeConfigureAdd",{
                url:'/recharge/configure/add',
                templateUrl:'tpl/recharge/recharge_configure_add.html',
                resolve: {
                    deps: ['$ocLazyLoad',
                        function ($ocLazyLoad) {
                            return $ocLazyLoad.load([
                                'js/services/recharge/recharge_configure.js',
                                'js/controllers/recharge/recharge_configure.js',
                            ]);
                        }
                    ]
                }
            })

            .state("app.rechargeConfigureEdit",{
                url:'/recharge/configure/edit/:id',
                templateUrl:'tpl/recharge/recharge_configure_edit.html',
                resolve: {
                    deps: ['$ocLazyLoad',
                        function ($ocLazyLoad) {
                            return $ocLazyLoad.load([
                                'js/services/recharge/recharge_configure.js',
                                'js/controllers/recharge/recharge_configure.js'
                            ]);
                        }
                    ]
                }
            })

            .state("app.rechargeRecord",{
                url:'/recharge/Record',
                templateUrl:'tpl/recharge/recharge_record.html',
                resolve: {
                    deps: ['$ocLazyLoad',
                        function ($ocLazyLoad) {
                            return $ocLazyLoad.load([
                                'js/controllers/recharge/recharge_record.js'
                            ]);
                        }
                    ]
                }
            })

              //config
              .state('app.systemConfig',{
                  url:'/system/config',
                  templateUrl:'tpl/systemSetting/system_config.html',
                  resolve: {
                      deps: ['uiLoad',
                          function (uiLoad) {
                              return uiLoad.load([
                                  'js/controllers/systemSetting/system_config.js',
                                  'js/services/systemSetting/system_config.js',
                              ]);
                          }]
                  }
              })

              //sell
              .state('app.sellSeting',{
                  url:'/sell/seting',
                  templateUrl:'tpl/sell/sell_seting.html',
                  resolve: {
                      deps: ['uiLoad',
                          function (uiLoad) {
                              return uiLoad.load([
                                  'js/controllers/sell/sell_seting.js',
                                  'js/services/sell/sell_seting.js',
                              ]);
                          }]
                  }
              })

              .state('app.revenueSetting',{
                  url:'/revenue/setting',
                  templateUrl:'tpl/sell/revenue_setting.html',
                  resolve: {
                      deps: ['uiLoad',
                          function (uiLoad) {
                              return uiLoad.load([
                                  'js/controllers/sell/revenue_setting.js',
                                  'js/services/sell/revenue_setting.js',
                              ]);
                          }]
                  }
              })

              .state('app.revenueSettingAdd',{
                  url:'/revenue/setting/add',
                  templateUrl:'tpl/sell/revenue_setting_add.html',
                  resolve: {
                      deps: ['uiLoad',
                          function (uiLoad) {
                              return uiLoad.load([
                                  'js/controllers/sell/revenue_setting.js',
                                  'js/services/sell/revenue_setting.js',
                              ]);
                          }]
                  }
              })

              .state("app.revenueSettingEdit",{
                  url:'/question/revenueSettingEdit:id',
                  templateUrl:'tpl/sell/revenue_setting_edit.html',
                  resolve: {
                      deps: ['$ocLazyLoad',
                          function( uiLoad){
                              return uiLoad.load([
                                  'js/services/sell/revenue_setting.js',
                                  'js/controllers/sell/revenue_setting.js',
                              ]);
                          }
                      ]
                  }
              })

              //shopLocated 商家入驻信息
              .state("app.shopLocated",{
                url:'/shop/located',
                templateUrl:'tpl/shopLocated/shop_located.html',
                resolve: {
                    deps: ['$ocLazyLoad',
                        function( uiLoad){
                            return uiLoad.load([
                                'js/services/shopLocated/shop_located.js',
                                'js/controllers/shopLocated/shop_located.js',
                            ]);
                        }
                    ]
                }
            })
            .state("app.shopLocatedEdit",{
                url:'/shop/located/edit:id',
                templateUrl:'tpl/shopLocated/shop_located_edit.html',
                resolve: {
                    deps: ['$ocLazyLoad',
                        function( uiLoad){
                            return uiLoad.load([
                                'js/services/shopLocated/shop_located_edit.js',
                                'js/controllers/shopLocated/shop_located_edit.js',
                            ]);
                        }
                    ]
                }
            })
            .state("app.shopLocatedView",{
                url:'/shop/located/view:id',
                templateUrl:'tpl/shopLocated/shop_located_view.html',
                resolve: {
                    deps: ['$ocLazyLoad',
                        function( uiLoad){
                            return uiLoad.load([
                                'js/services/shopLocated/shop_located_view.js',
                                'js/controllers/shopLocated/shop_located_view.js',
                            ]);
                        }
                    ]
                }
            })
            .state("app.shopLocatedIntegral",{
                  url:'/shop/located/integral',
                  templateUrl:'tpl/shopLocated/shop_located_integral.html',
                  resolve: {
                      deps: ['$ocLazyLoad',
                          function( uiLoad){
                              return uiLoad.load([
                                  'js/services/shopLocated/shop_located_integral.js',
                                  'js/controllers/shopLocated/shop_located_integral.js',
                              ]);
                          }
                      ]
                  }
            })



            //商品管理
            .state("app.goodsManage",{
                url:'/goods/manage',
                templateUrl:'tpl/goods/goods_manage.html',
                resolve: {
                    deps: ['$ocLazyLoad',
                        function( uiLoad){
                            return uiLoad.load([
                                'js/services/goods/goods_manage.js',
                                'js/controllers/goods/goods_manage.js'
                            ]);
                        }
                    ]
                }
            })

            .state("app.goodsManageSoldOut",{
                url:'/goods/manage/sold/out/:id',
                templateUrl:'tpl/goods/goods_manage_sold_out.html',
                resolve: {
                    deps: ['uiLoad',
                        function (uiLoad) {
                            return uiLoad.load([ 'js/services/goods/goods_manage.js',
                                'js/controllers/goods/goods_manage.js']);
                        }]
                }
            })

             //系统信息分类管理
             .state("app.systemType",{
                    url:'/systemType',
                    templateUrl:'tpl/systemSetting/system_type.html',
                    resolve: {
                         deps: ['$ocLazyLoad',
                             function( $ocLazyLoad){
                                return $ocLazyLoad.load('angularFileUpload').then(
                                    function(){
                                         return $ocLazyLoad.load([
                                         'css/content-css/goods/goods_types.css',
                                        'css/content-css/upload/picture_upload.css',
                                        'js/services/systemSetting/system_type.js',
                                        'js/controllers/systemSetting/system_type.js'
                                        ]);
                                    }
                                );
                            }]
                    }
                })

              //messageTemplate
              .state("app.messageTemplate",{
                  url: '/message/template',
                  templateUrl: 'tpl/message/message_template.html'
              })


              //tag
              .state("app.tag",{
                  url: '/tag',
                  templateUrl: 'tpl/tag/tag.html',
                  resolve: {
                      deps: ['$ocLazyLoad',
                          function( uiLoad){
                              return uiLoad.load([
                                  'js/controllers/tag/tag.js',
                                  'js/services/tag/tag.js',
                              ]);
                          }
                      ]
                  }
              })
              .state("app.tagAdd",{
                  url: '/tag/add',
                  templateUrl: 'tpl/tag/tag_add.html',
                  resolve: {
                      deps: ['$ocLazyLoad',
                          function( uiLoad){
                              return uiLoad.load([
                                  'js/controllers/tag/tag.js',
                                  'js/services/tag/tag.js',
                              ]);
                          }
                      ]
                  }
              })
              .state("app.tagEdit",{
                  url: '/tag/edit/:id',
                  templateUrl: 'tpl/tag/tag_edit.html',
                  resolve: {
                      deps: ['$ocLazyLoad',
                          function( uiLoad){
                              return uiLoad.load([
                                  'js/controllers/tag/tag.js',
                                  'js/services/tag/tag.js',
                              ]);
                          }
                      ]
                  }
              })

              //label
              .state("app.label",{
                  url: '/label',
                  templateUrl: 'tpl/label/label.html',
                  resolve: {
                      deps: ['$ocLazyLoad',
                          function ($ocLazyLoad) {
                              return $ocLazyLoad.load(['angularFileUpload','ui.select']).then(
                                  function () {
                                      return $ocLazyLoad.load([
                                          'js/controllers/label/label.js',
                                          'js/services/label/label.js'
                                      ]);
                                  }
                              );
                          }]
                  }
              })

              .state("app.labelItems",{
                  url: '/label/items/:id',
                  templateUrl: 'tpl/label/label_items.html',
                  resolve: {
                      deps: ['$ocLazyLoad',
                          function( uiLoad){
                              return uiLoad.load([
                                  'js/controllers/label/label_items.js',
                                  'js/services/label/label_items.js'
                              ]);
                          }
                      ]
                  }
              })



              // access
              .state('access', {
                  abstract:true,
                  url: '/access',
                  template: '<div ui-view class="fade-in-right-big smooth h-full bg-white" ng-init="app.settings.headerFixed=false"></div>'
              })
              .state('access.login', {
                  url: '/login',
                  templateUrl: 'tpl/access/login.html',
                  resolve: {
                      deps: ['uiLoad',
                          function (uiLoad) {
                              return uiLoad.load([
                                  'js/controllers/access/login.js',
                                  'js/services/access/login.js',
                                  'js/util/public_key.js',
                                  'js/util/jsencrypt.min.js',
                                  'css/content-css/access/login.css'
                              ]);
                          }
                      ]
                  }
              })

              // agent area
              .state("app.agentArea",{
                  url: '/agentArea',
                  templateUrl: 'tpl/agent/agent_area.html',
                  resolve: {
                      deps: ['uiLoad',
                          function (uiLoad) {
                              return uiLoad.load([
                                  'js/controllers/agent/agent_area.js',
                                  'js/controllers/agent/agent_area_add.js',
                                  'js/controllers/agent/agent_area_delete.js',
                                  'js/controllers/agent/agent_area_edit.js',
                                  'js/services/area/area.js',
                                  'js/services/agent/agent_area.js'
                              ]);
                          }
                      ]
                  }
              })

              // profit setting
              .state("app.profitSetting",{
                  url: '/profitSetting',
                  templateUrl: 'tpl/agent/profit_setting.html',
                  resolve: {
                      deps: ['uiLoad',
                          function (uiLoad) {
                              return uiLoad.load([
                                  'js/controllers/agent/profit_setting.js',
                                  'js/services/agent/profit_setting.js',
                                  'js/controllers/agent/profit_setting_edit.js',
                              ]);
                          }
                      ]
                  }
              })

              // agent
              .state("app.agent",{
                  url: '/agent',
                  templateUrl: 'tpl/agent/agent.html',
                  resolve: {
                      deps: ['$ocLazyLoad',
                          function( $ocLazyLoad){
                              return $ocLazyLoad.load('ui.select').then(
                                  function(){
                                      return $ocLazyLoad.load([
                                          'css/content-css/agent/agent.css',
                                          'js/controllers/agent/agent.js',
                                          'js/controllers/agent/agent_add.js',
                                          'js/controllers/agent/agent_edit.js',
                                          'js/services/agent/agent.js',
                                          'js/filters/ui_select.js',
                                      ]);
                                  }
                              );
                          }]
                  }
              })

              // bulletinBoard
              .state("app.bulletinBoard",{
                  url: '/bulletinBoard',
                  templateUrl: 'tpl/bulletin_board/bulletin_board.html',
                  resolve: {
                      deps: ['uiLoad',
                          function (uiLoad) {
                              return uiLoad.load([
                                  'js/controllers/bulletin_board/bulletin_board.js',
                                  'js/services/bulletin_board/bulletin_board.js',
                              ]);
                          }
                      ]
                  }
              })

              // agentWithdrawals
              .state("app.agentWithdrawals",{
                  url: '/agentWithdrawals',
                  templateUrl: 'tpl/agent_withdrawals/agent_withdrawals.html',
                  resolve: {
                      deps: ['uiLoad',
                          function (uiLoad) {
                              return uiLoad.load([
                                  'js/controllers/agent_withdrawals/agent_withdrawals.js',
                                  'js/services/agent_withdrawals/agent_withdrawals.js',
                                  'js/filters/agent_withdrawals.js'
                              ]);
                          }
                      ]
                  }
              })
              .state('app.promotionPoster',{
                  url:'/promotion/poster',
                  templateUrl:'tpl/marketingManager/promotion_poster.html',
                  resolve:{
                      deps:['$ocLazyLoad',function($ocLazyLoad){
                          return $ocLazyLoad.load('angularFileUpload').then(function(){
                              return $ocLazyLoad.load([
                                  'css/content-css/marketingManager/promotion_poster.css',
                                  'js/controllers/marketingManager/promotion_poster.js',
                                  'js/services/marketingManager/promotion_poster.js'
                              ])
                          });
                      }]
                  }
              })
              .state('app.promotionPosterAdd',{
                  url:'/promotion/poster/add/:id',
                  templateUrl:'tpl/marketingManager/promotion_poster_add.html',
                  resolve:{
                      deps:['$ocLazyLoad',function($ocLazyLoad){
                          return $ocLazyLoad.load('angularFileUpload').then(function(){
                              return $ocLazyLoad.load([
                                  'css/content-css/marketingManager/promotion_poster.css',
                                  'js/controllers/marketingManager/promotion_poster_add.js',
                                  'js/services/marketingManager/promotion_poster_add.js'
                              ])
                          });
                      }]
                  }
              })
              .state('app.myContacts',{
                  url:'/my/contacts',
                  templateUrl:'tpl/marketingManager/my_contacts.html',
                  resolve:{
                      deps:['$ocLazyLoad',function($ocLazyLoad){
                          return $ocLazyLoad.load([
                              'css/content-css/marketingManager/my_contacts.css',
                              'js/controllers/marketingManager/my_contacts.js',
                              'js/services/marketingManager/my_contacts.js'
                          ])
                      }]
                  }
              })
              .state('app.myContactsFirst',{
                  url:'/my/contacts/first/:id/:parentName/:level',
                  templateUrl:'tpl/marketingManager/my_contacts_first.html',
                  resolve:{
                      deps:['$ocLazyLoad',function($ocLazyLoad){
                          return $ocLazyLoad.load([
                              'css/content-css/marketingManager/my_contacts.css',
                              'js/controllers/marketingManager/my_contacts_children.js',
                              'js/services/marketingManager/my_contacts_children.js'
                          ])
                      }]
                  }
              })
              .state('app.myContactsSecond',{
                  url:'/my/contacts/second/:id/:parentName/:level',
                  templateUrl:'tpl/marketingManager/my_contacts_second.html',
                  resolve:{
                      deps:['$ocLazyLoad',function($ocLazyLoad){
                          return $ocLazyLoad.load([
                              'css/content-css/marketingManager/my_contacts.css',
                              'js/controllers/marketingManager/my_contacts_children.js',
                              'js/services/marketingManager/my_contacts_children.js'
                          ])
                      }]
                  }
              })
              .state("app.agentIntegral",{
                  url: '/agentIntegral',
                  templateUrl: 'tpl/agent/agent_integral.html',
                  resolve: {
                      deps: ['uiLoad',
                          function (uiLoad) {
                              return uiLoad.load([
                                  'js/controllers/agent/agent_integral.js',
                                  'js/services/agent/agent_integral.js',
                              ]);
                          }
                      ]
                  }
              })
      }
    ]
  );